<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="tutorial.css">
<TITLE>
High Level Design
</TITLE>
</HEAD>
<BODY >
<A HREF="tutorial002.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="tutorial004.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H1 CLASS="chapter"><A NAME="htoc5">Chapter&nbsp;2</A>&nbsp;&nbsp;High Level Design</H1><UL>
<LI><A HREF="tutorial003.html#toc4">Application structure</A>
<LI><A HREF="tutorial003.html#toc5">Queries</A>
<LI><A HREF="tutorial003.html#toc6">API</A>
<LI><A HREF="tutorial003.html#toc7">High level structure</A>
<LI><A HREF="tutorial003.html#toc8">Modules</A>
<LI><A HREF="tutorial003.html#toc9">Naming schemes</A>
<LI><A HREF="tutorial003.html#toc10">Documentation</A>
</UL>

<A NAME="highleveldesign"></A>
In this chapter we discuss some high-level design decisions which should be 
clarified before starting the actual development of any code.<BR>
<BR>
<A NAME="toc4"></A>
<H2 CLASS="section"><A NAME="htoc6">2.1</A>&nbsp;&nbsp;Application structure</H2>
We first review the overall application structure<A NAME="@default5"></A> found in systems developed at Parc Technologies (at least those using ECLiPSe for part of their development). We distinguish between two application types, one a full application with user-interface, database, reporting, etc, and the other a much smaller system, typically reading data from and to files and performing a single, batch type operation.
<BLOCKQUOTE CLASS="figure"><DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV>
<DIV CLASS="center">
<IMG SRC="tutorial001.gif"></DIV>
<BR>
<BR>
<DIV CLASS="center">Figure 2.1: Full application</DIV><BR>
<BR>

<A NAME="fullapplication"></A>
<DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV></BLOCKQUOTE>
<BLOCKQUOTE CLASS="figure"><DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV>
<DIV CLASS="center">
<IMG SRC="tutorial002.gif"></DIV>
<BR>
<BR>
<DIV CLASS="center">Figure 2.2: Batch type application</DIV><BR>
<BR>

<A NAME="batchtypeapplication"></A>
<DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV></BLOCKQUOTE>
Examples of the first type (see figure&nbsp;<A HREF="#fullapplication">2.1</A>) are Parc Technologies applications (http://www.parc-technologies.com) like AirPlanner<A NAME="@default6"></A> and RiskWise<A NAME="@default7"></A><SUP><A NAME="text1" HREF="#note1">1</A></SUP>, where everything except the problem solver is developed in Java<A NAME="@default8"></A> or related tools. The interface between the main application and the problem solver written in ECLiPSe is via a Java-ECLiPSe interface. In this interface, the main application poses queries for the ECLiPSe solver, passing data and arguments into ECLiPSe. The problem solver then runs the query and returns results as variable bindings in the given query. The Java side only knows about these queries, their data format and the expected results. The internals of the solver, how the queries are resolved, is completely hidden. This defines a nice interface between the application parts, as long as the queries are well defined and documented. Once that design is frozen, the developers for the different parts can continue development independently from each other, using stubs or dummy routines to simulate the other application parts. <BR>
<BR>
The NDI-Mapper<A NAME="@default9"></A> in RiskWise is an example of the second application type (see figure&nbsp;<A HREF="#batchtypeapplication">2.2</A>). The application reads some data files (defined in a clear specification), performs some operation on the data and produces results in another set of data files. The top-level query typically just states where the data should be found and where the results should be written to. This batch command <A NAME="@default10"></A>then internally calls more detailed routines to load data, etc.<BR>
<BR>
<A NAME="toc5"></A>
<H2 CLASS="section"><A NAME="htoc7">2.2</A>&nbsp;&nbsp;Queries</H2>
For each required function of the interface, we should define a specific query<A NAME="@default11"></A>. The query consists of three parts. The first is the predicate name, which obviously should have a relation to the intended function. The second part consists of the input arguments<A NAME="@default12"></A>, which are used to pass information from the outside to the problem solver. The structure of these arguments should be as simple as possible, easy to generate and to analyze. The third part consists of the output arguments<A NAME="@default13"></A>, which are used to pass information from the problem solver back to the calling interface. When calling the query these arguments will be free variables, which are instantiated inside the solver to some result data structure.<BR>
<BR>
The critical issue in defining the queries lies in identifying which data are required and/or produced, without building an actual implementation of the system. Another issue is the format of the data, which should allow a simple and efficient implementation without extra overhead for data manipulation. It is most important to get this interface right from the start, as any change will create re-work and problems integrating different versions of the software.<BR>
<BR>
<A NAME="toc6"></A>
<H2 CLASS="section"><A NAME="htoc8">2.3</A>&nbsp;&nbsp;API</H2>
The API <A NAME="@default14"></A>(application programmer's interface) definition should be finished and signed-off by the designers of the main application and of the problem solver before any code is written<SUP><A NAME="text2" HREF="#note2">2</A></SUP>. The syntax of each query (predicate) should be defined completely, stating the argument structure and types for both input and outputs. A mode declaration should be used to indicate input and output arguments.<BR>
<BR>
An important part of the API definition is the identification of constraints<A NAME="@default15"></A> attached to the data. Constraints in this context are conditions that the data must satisfy in order to obtain meaningful results. These constraints ensure that the data set is complete, minimal and consistent. 
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<B>complete</B><DD CLASS="dd-description"> All data required for the application should be present, with proper links between different records. An example from RiskWise: if an interface of a router is mentioned, then the router to which the interface belongs should be mentioned as well.<BR>
<BR>
<DT CLASS="dt-description"><B>minimal</B><DD CLASS="dd-description"> The data set should not contain any unneeded information, like duplicated records or references to objects that are not used in the system. <BR>
<BR>
<DT CLASS="dt-description"><B>consistent</B><DD CLASS="dd-description"> The data should be consistent overall, so that different records can be used without verifying their correctness every time. This can increase processing speed dramatically, and simplifies the code inside the application.
</DL>
Any constraints identified should be added to the specification of a data record in a numbered list, so that they can be identified easily. The example below shows the constraints attached to the<A NAME="@default16"></A> 
<PRE CLASS="verbatim">backbone_line(Node1, Interface1, Node2, Interface2)
</PRE>structure in RiskWise.
<OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
Each pair (Node, Interface) occurs at most once in the entries. 
<LI CLASS="li-enumerate">There can be no entry starting and ending in the same node. 
<LI CLASS="li-enumerate">Each node Node1 must have a node/2 fact. 
<LI CLASS="li-enumerate">Each node Node2 must have a node/2 fact. 
<LI CLASS="li-enumerate">The interface Interface1 cannot be 'local'. 
<LI CLASS="li-enumerate">The interface Interface2 cannot be 'local'. 
<LI CLASS="li-enumerate">Each pair (Node1, Interface1) must have a bandwidth/5 fact. 
<LI CLASS="li-enumerate">Each pair (Node2, Interface2) must have a bandwidth/5 fact. 
<LI CLASS="li-enumerate">There can be no backbone line between two net nodes. 
<LI CLASS="li-enumerate">There is at most one direct connection between two nodes, each line is uniquely described by the pair (Node1, Node2). 
<LI CLASS="li-enumerate">If there is a connection (Node1, Node2) between two nodes, then we cannot have the inverse connection (Node2, Node1) as well. 
</OL>
For major application interfaces<A NAME="@default17"></A>, in particular those linking the Java<A NAME="@default18"></A> and the ECLiPSe side, it is recommended to write specific code checking the data for compliance with the constraints. This simplifies the integration task by either pointing out which data do not satisfy the constraints and are therefore invalid, or by guaranteeing that the data passed are correct, and any problem is on the receiving side of the interface.<BR>
<BR>
At this point it is also a good idea to write some dummy batch tests which create the proper interface structures to test the queries. These dummy tests must satisfy the constraints on the data, but do not need to contain useful data. They will be used to exercise the interface and the data constraint checks for coverage with consistent data while integration testing is not yet possible.<BR>
<BR>
<A NAME="toc7"></A>
<H2 CLASS="section"><A NAME="htoc9">2.4</A>&nbsp;&nbsp;High level structure</H2>
Once the external API is clearly defined, we can start looking at the next level of internal structure. This will depend on the intended purpose of the system, but we can identify some typical structures that can be found in many applications. Here, we present two typical designs, one for solving combinatorial problems, the other for transforming data.<BR>
<BR>

<H3 CLASS="subsection"><A NAME="htoc10">2.4.1</A>&nbsp;&nbsp;Classical LSCO structure</H3>
This structure is typical for large scale combinatorial optimization<A NAME="@default19"></A> (LSCO)<A NAME="@default20"></A> problems. The flow analysis part of RiskWise follows this structure. It consists of five parts, where each performs one particular task. 
<BLOCKQUOTE CLASS="figure"><DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV>
<DIV CLASS="center">
<IMG SRC="tutorial003.gif"></DIV>
<BR>
<BR>
<DIV CLASS="center">Figure 2.3: LCSO Application structure</DIV><BR>
<BR>

<A NAME="lscoapplicationstructure"></A>
<DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV></BLOCKQUOTE>
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<B>prepare data</B><DD CLASS="dd-description">In this module we read the data and prepare the data structures that are required for the problem solver. These data structures should group information that belongs together in one record, and must allow fast access to the data, so that the following application parts can access it easily.
<DT CLASS="dt-description"><B>create variables</B><DD CLASS="dd-description"> This is followed by the variable generation, where we create all variables that will be used in the solver. These variables will simply be placed in slots already provided in the data structures.
<DT CLASS="dt-description"><B>create constraints</B><DD CLASS="dd-description"> Once the variables are in place, we can create the constraints between them. This generation should be done in such a way that we can disable or exchange constraints easily.
<DT CLASS="dt-description"><B>find solution</B><DD CLASS="dd-description"> Having stated all constraints, we can then find a solution (or the optimal solution) to the problem. This will instantiate the problem variables that we have created in step 2.
<DT CLASS="dt-description"><B>output results</B><DD CLASS="dd-description"> We then have to take the solution and produce the output results, either as data structures, or by creating some result files.
</DL>
It may not be immediately obvious, but it is very important to clearly separate the different phases. For example, it sometimes may seem faster to generate some variables together with the constraints that are set up between them, as this will save at least one scan of the data structure. But at the same time it makes it much more difficult to disable this constraint or to rearrange the constraints in a different order.<BR>
<BR>
Exceptions to this rule are auxiliary variables which are only introduced to express some constraint and which are not part of the problem variables proper, or constraints that are introduced inside the search process in order to find a solution.<BR>
<BR>

<H3 CLASS="subsection"><A NAME="htoc11">2.4.2</A>&nbsp;&nbsp;Data transformation structure</H3>
The second high-level design is a data transformation<A NAME="@default21"></A> structure, used for example in the NDI-Mapper<A NAME="@default22"></A> application. It consists of three parts.
<BLOCKQUOTE CLASS="figure"><DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV>
<DIV CLASS="center">
<IMG SRC="tutorial004.gif"></DIV>
<BR>
<BR>
<DIV CLASS="center">Figure 2.4: Data transformation structure</DIV><BR>
<BR>

<A NAME="datatransformationstructure"></A>
<DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV></BLOCKQUOTE>
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<B>read input</B><DD CLASS="dd-description"> In the first module, we read all data into data structures.
<DT CLASS="dt-description"><B>transform</B><DD CLASS="dd-description"> We then use these data structures to create new, transformed data in the tranformation part of the application.
<DT CLASS="dt-description"><B>output results</B><DD CLASS="dd-description"> The last module consists in an output routine, which creates the result data files.
</DL>
The main limitation of this approach is that all data must be loaded into the application (in main memory)<A NAME="@default23"></A>. This limits the size of the data sets that can be handled to several megabytes. On the other hand, all information can be made available in an efficient way using lookup hash tables or arrays, so that the implementation of the transformation is quite simple.<BR>
<BR>

<H3 CLASS="subsection"><A NAME="htoc12">2.4.3</A>&nbsp;&nbsp;Data flow considerations</H3>
Once we have decided on a top-level structure, we must consider the input/output arguments of each part. We have to decide which data must be fed into which modules, where new data structures will be created and which other modules require this data. For each piece of information we must identify its source and its possible sinks. Designing these data flows is an iterative process, assigning functionality to modules and making sure that the required information is available. The design aim should be to minimize the amount of information that must be passed across module boundaries and to arrange functions in the correct data flow order, so that all information is produced before it is required in another module.<BR>
<BR>
It can be helpful to draw a data flow graph<A NAME="@default24"></A> of the system as a directed graph, showing the main components as nodes and links between sources and sinks of information. A graph of this form should not contain any cycles, and if many links exist between two nodes, we may have to reconsider the split of functionality between. <BR>
<BR>
<A NAME="toc8"></A>
<H2 CLASS="section"><A NAME="htoc13">2.5</A>&nbsp;&nbsp;Modules</H2>
We now have an idea of the overall structure of our application and can now turn this into the top-level code structure. We use the module concept of ECLiPSe to clearly separate the components and to define fixed interfaces between them. Each component of our top-level structure should define a module in one file. We place a <I>module</I><A NAME="@default25"></A> directive at the beginning of the file to indicate the module name. <BR>
<BR>
The following examples are taken from the file <I>flow_prepare_data.ecl</I><A NAME="@default26"></A>.
<PRE CLASS="verbatim">
:-module(flow_prepare_data).
</PRE>

<H3 CLASS="subsection"><A NAME="htoc14">2.5.1</A>&nbsp;&nbsp;Making predicates available</H3>
The <I>export</I><A NAME="@default27"></A> directive makes some predicate definition available to users outside the module. All other predicates can be only used inside the module, but cannot be used from outside. A module effectively hides all non exported predicates in a separate name space<A NAME="@default28"></A>, so that we do not have to worry about using the same name in two different modules. <BR>
<BR>
In our example, the module exports a single predicate <I>prepare_data/12</I><A NAME="@default29"></A>.
<PRE CLASS="verbatim">
:-export(prepare_data/12).
</PRE>

<H3 CLASS="subsection"><A NAME="htoc15">2.5.2</A>&nbsp;&nbsp;Using packaged functionality</H3>
If we want to use some function which has been exported from some module in another module, we have to use the <I>use_module</I><A NAME="@default30"></A> directive. It says that all exported predicates of a module should be available in the current module, and ensures that the module is loaded into the system. We can use the same module in more than one place, but the directive makes sure it is loaded only once. The <I>use_module</I> directive assumes that the module is defined in a file in the current directory, which has the same name as the module. <BR>
<BR>
The <I>flow_prepare_data</I> module uses predicates from a variety of sources.
<PRE CLASS="verbatim">
:-use_module(data_topology).
:-use_module(data_peering_policy).
:-use_module(data_traffic).
:-use_module(data_routing).
:-use_module(data_group).
:-use_module(data_general).

:-use_module(flow_statistics).
:-use_module(flow_structures).
:-use_module(flow_utility).
:-use_module(report).
:-use_module(report_utility).
:-use_module(utility).
</PRE>
If we want to use predicates defined in some library, we have to use the <I>lib</I><A NAME="@default31"></A><A NAME="@default32"></A> directive. It loads the library from the library directory in the ECLiPSe installation, unless we have changed the library path setting to include other directories in the search path.
Libraries in ECLiPSe are modules like all others, they are just stored in a different place in the file system.<BR>
<BR>
In our example, a single library called &#8220;hash&#8221; is loaded.
<PRE CLASS="verbatim">
:-lib(hash).
</PRE>
<A NAME="toc9"></A>
<H2 CLASS="section"><A NAME="htoc16">2.6</A>&nbsp;&nbsp;Naming schemes</H2>
We now introduce a naming scheme<A NAME="@default33"></A> that should be used to define identifiers for the various entities in an ECLiPSe program. A consistent naming scheme makes it easier to maintain and modify the program, and also makes sure that contributions from different programmers can be merged without extra work. The scheme presented here is used for RiskWise.<BR>
<BR>

<H3 CLASS="subsection"><A NAME="htoc17">2.6.1</A>&nbsp;&nbsp;Modules and files</H3>
Each module<A NAME="@default34"></A><A NAME="@default35"></A> must have a unique name of the form [a-z][a-z_]+ . There is a one-to-one correspondence of modules and program files.<BR>
<BR>
All program files in an application should be placed in a single directory, with each file named after the module it contains. The extension for ECLiPSe programs is <I>.ecl</I>.<BR>
<BR>

<H3 CLASS="subsection"><A NAME="htoc18">2.6.2</A>&nbsp;&nbsp;Predicates</H3>
Predicate names<A NAME="@default36"></A><A NAME="@default37"></A> are of form [a-z][a-z_]*[0-9]* . Underscores are used to separate words. Digits should only be used at the end of the name. Words should be English. The top-level query of an application should be named <I>top</I><A NAME="@default38"></A>, and should execute a default query with some valid data set. Although predicates in different modules can use the same name, this can be confusing and should be avoided. You should also avoid using the same predicate name with different arity. Although legal, this can create problems when modifying code.<BR>
<BR>

<H3 CLASS="subsection"><A NAME="htoc19">2.6.3</A>&nbsp;&nbsp;Variables</H3>
Variable names <A NAME="@default39"></A><A NAME="@default40"></A>are of form [A-Z_][a-zA-Z]*[0-9]* . Separate words start with capital letters. Digits should only be used at the end. Words should be English. If a variable occurs only once in a clause, then its name should start with an underscore<A NAME="@default41"></A>. This marks it as a <I>singleton variable</I><A NAME="@default42"></A>, and stops compiler warnings about the single occurrence of a variable. If a variable occurs more than once in a clause, then its name should not start with an underscore.<BR>
<BR>
<A NAME="toc10"></A>
<H2 CLASS="section"><A NAME="htoc20">2.7</A>&nbsp;&nbsp;Documentation</H2>
A program that is not documented is not usable. It is very hard to deduce the intention of a program piece just from the implementation, but even a few sentences of explanation can simplify this task dramatically. On the other hand, it is imperative that the documentation and the implementation are consistent. In ECLiPSe we use in-line <I>comment</I> <A NAME="@default43"></A>directives to integrate the documentation with the program code. This makes it much easier to keep the documentation up to date than with a separate description file. <BR>
<BR>

<H3 CLASS="subsection"><A NAME="htoc21">2.7.1</A>&nbsp;&nbsp;Comment directive</H3>
The <I>comment</I> directives are placed in the source code together with other parts of the program. The ECLiPSe system contains some library predicates which extract the comment directives and build a set of interrelated HTML <A NAME="@default44"></A>pages for the documentation. The same system is used to generate the reference manual <A NAME="@default45"></A>documentation of the library predicates. The <I>comment</I> directives come in two flavours. One is a comment for a module<A NAME="@default46"></A><A NAME="@default47"></A>, which gives an overview what is module is for. As an example we again use the file <I>flow_prepare_data.ecl</I>.
<PRE CLASS="verbatim">
:-comment(summary,"This file contains the data preparation for 
the flow analysis.").
:-comment(desc,html("This file contains the data preparation for 
the flow analysis.
")).
:-comment(author,"R. Rodosek, H. Simonis").
:-comment(copyright,"Parc Technologies Ltd").
:-comment(date,"$Date: 2006/09/23 01:48:40 $").
</PRE>
The other form of the <I>comment</I> directive is the predicate comment<A NAME="@default48"></A><A NAME="@default49"></A>, which describes a particular predicate.
<PRE CLASS="verbatim">
:-comment(prepare_data/12,[
summary:"creates the data structures for the flow analysis
",
amode:prepare_data(+,+,+,-,-,-,-,-,-,+,-,-),
args:[
"Dir":"directory for report output",
"Type":"the type of report to be generated",
"Summary":"a summary term",
"Nodes":"a nodes data structure",
"Interfaces":"a interfaces data structure",
"Lines":"a lines data structure",
"Groups":"a groups data structure",
"CMatrix":"a matrix (indexed by nodes) of contributions to 
traffic",
"FMatrix":"a matrix (indexed by nodes) of flow variables",
"ScaleFactor":"the scale factor applied to the traffic data",
"Sizes":"the sizes of min, small, large, max packets",
"PMatrix":"The Pi Matrix containing the next hop information, 
indexed by node keys"
],
desc:html("
This route creates the data structures for the flow analysis. 
...
"),
see_also:[hop/3]
]).

</PRE>
The exact form of the different fields is described in the the documentation of the <I>directives</I> <A NAME="@default50"></A>section of the ECLiPSe built-in predicate documentation in the ECLiPSe reference manual.<BR>
<BR>

<H3 CLASS="subsection"><A NAME="htoc22">2.7.2</A>&nbsp;&nbsp;Documenting all interfaces</H3>
Many predicates in a module only perform very simple tasks which are immediately obvious from the implementation. It would be overkill to document all these predicates. We are working with a rule that all module interfaces must be documented, as well as all predicates which either have a complex implementation or which are expected to be customized by the user.<BR>
<BR>
For predicates without a comment directive, we should use a one line description by a normal ECLiPSe comment in the source code. <BR>
<BR>

<H3 CLASS="subsection"><A NAME="htoc23">2.7.3</A>&nbsp;&nbsp;Mode declaration</H3>
We also use mode declarations <A NAME="@default51"></A>to document the calling pattern <A NAME="@default52"></A>of predicates. This uses four symbols
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<B>+</B><DD CLASS="dd-description"> for arguments which are <I>instantiated</I><A NAME="@default53"></A>, i.e. are not free variables, but which may contain variables
<DT CLASS="dt-description"><B>++</B><DD CLASS="dd-description"> for arguments that are <I>ground</I><A NAME="@default54"></A>, i.e. do not contain variables
<DT CLASS="dt-description"><B>-</B><DD CLASS="dd-description"> for arguments which are free variables
<DT CLASS="dt-description"><B>?</B><DD CLASS="dd-description"> for an unknown mode, where we either don't know the mode or we do not care if the argument is instantiated or not
</DL>
While the compiler uses the mode declarations for code optimization, we basically only use it to document the calling pattern. It allows to isolate a predicate definition and to understand its purpose without checking all callers<SUP><A NAME="text3" HREF="#note3">3</A></SUP>.<BR>
<BR>
To continue with our example module <I>flow_prepare_data</I>, the one exported predicate has the following mode declaration<SUP><A NAME="text4" HREF="#note4">4</A></SUP>.
<PRE CLASS="verbatim">
:-mode prepare_data(+,+,+,-,-,-,-,-,-,+,-,-).
</PRE>
<H3 CLASS="subsection"><A NAME="htoc24">2.7.4</A>&nbsp;&nbsp;Documentation query</H3>
If a system contains many modules, it can be helpful to provide a query which automatically generates the documentation for all files. In RiskWise, there is a module <I>document</I> <A NAME="@default55"></A>with an entry point <I>document/0</I> which creates the complete documentation tree. It uses the built-in predicates <I>icompile/1</I> and <I>ecis_to_htlms/4</I> to extract the documentation information from the source files and to build the HTML files required. Whenever we add a new module to the source of the application, we have to add its name into the <I>components</I> list.
<PRE CLASS="verbatim">
document:-
        components(L),
        (foreach(Module,L) do
           icompile(Module)
        ),
        getcwd(Dir),
        ecis_to_htmls([Dir],'HTML Doc',[],'ApplicationName').


components([
        module1,
        module2,
        ...
        modulen]).
</PRE><HR WIDTH="50%" SIZE=1><DL CLASS="list"><DT CLASS="dt-list"><A NAME="note1" HREF="#text1"><FONT SIZE=5>1</FONT></A><DD CLASS="dd-list">In the following we use a number of examples from the RiskWise application. It is a network analysis tool for IP networks, which uses a constraint solver to determine traffic pattern in the network. If this doesn't make any sense to you, relax. An understanding of the networking application domain is not required to follow this tutorial.
<DT CLASS="dt-list"><A NAME="note2" HREF="#text2"><FONT SIZE=5>2</FONT></A><DD CLASS="dd-list">This doesn't mean that the interface can't evolve over time, but at each time point there should be a current, valid definition of the API accepted by all concerned.
<DT CLASS="dt-list"><A NAME="note3" HREF="#text3"><FONT SIZE=5>3</FONT></A><DD CLASS="dd-list">Note that the compiler currently does not perform a mode check, i.e. it does not generate compile/runtime errors if a predicate is called with a wrong mode.
<DT CLASS="dt-list"><A NAME="note4" HREF="#text4"><FONT SIZE=5>4</FONT></A><DD CLASS="dd-list">We can see that we have not followed the rule to place all input arguments before the output arguments.
</DL>
<HR>
<A HREF="tutorial002.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="tutorial004.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
